package com.loren.demo24.controller;

import com.loren.demo24.form.DemoForm;
import com.loren.demo24.service.DemoService;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@AllArgsConstructor
public class DemoController {

    private final DemoService demoService;

    @PostMapping("/demo01")
    public List<Map<String, Object>> demo01(@RequestBody @Validated DemoForm demoForm) {
        return this.demoService.demo01(demoForm);
    }
}
